/*
 * Copyright (c) 2023. li.siyuan All rights reserved.
 */

package com.yanfan.attach.timeatsk;

import com.yanfan.attach.service.ISysIdStrategyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Id生成策略 定时任务
 */
@Slf4j
@Component
public class IdStrategyTask {

    @Autowired
    private ISysIdStrategyService sysIdStrategyService;

    @Scheduled(cron = "0 0 0 * * ?")   //每天的0点执行
    public void reset() {
        log.info("重置ID策略日期和编号");
        int i = sysIdStrategyService.reset();
    }

}
